package com.ys.多线程.p4线程常用方法1设置与获取线程名称;

import com.ys.多线程.p2创建线程实现Runnable接口.RabbitTask;
import com.ys.多线程.p2创建线程实现Runnable接口.TortoiseTask;

/**
 * 描述:
 *
 * @author CodeYang
 * @version 2021/1/4 23:59
 */
public class p1使用构造方法设置线程名称 {


    public static void main(String[] args) {
        // 1: 乌龟子任务,
        TortoiseTask tortoiseTask = new TortoiseTask();
        // 2:兔子子任务
        RabbitTask rabbitTask = new RabbitTask();

        Thread t1 = new Thread(tortoiseTask,"name-乌龟线程-");
        Thread t2 = new Thread(rabbitTask,"name-兔子线程-");


        t1.start();
        t2.start();
    }

    
}
